/**
 * Created by minigci.he on 16/9/8.
 */
console.log('------------------------');
console.log('test5');

// 魔术字符串
function getArea(shape, options){
    var area = 0;
    switch(shape){
        case 'Triangle':
            area = .5 * options.width * options.height;
            break;
    }
    return area;
}

var area = getArea('Triangle', {width: 100, height: 100});
console.log(area);

// 消除魔术字符串
var shapeType = {
    triangle: Symbol()
}

function getArea1(shape, options){
    var area = 0;
    switch(shape){
        case shapeType.triangle:
            area = .5 * options.width * options.height;
    }
    return area;
}

var area1 = getArea1(shapeType.triangle, {width: 100, height: 100})
console.log(area1);
